<!--正文导航-->
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta content="telephone=no" name="format-detection" /> 
<style>
	body > a:first-child,body > a:first-child img{ width: 0px !important; height: 0px !important; overflow: hidden; position: absolute}
	body{padding-bottom: 0 !important;}
</style>
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>找课程</title>
<link rel="stylesheet" href="{MODULE_URL}public/mobile/css/weixin.css">
<link rel="stylesheet" href="{OSSURL}public/mobile/css/reset.css">
<script src="{MODULE_URL}public/mobile/js/jquery.js"></script>
<script type="text/javascript" src="{MODULE_URL}public/mobile/js/jquery-1.11.3.min.js?v=4.9"></script>
</head>
<body>
<style>
dd.teacher_count li {font: 13px/18px "黑体";padding: 10px 60px 10px 34px;position: relative;background: url({OSSURL}public/mobile/img/teacher_inf.jpg) no-repeat 10px 15px;background-size: 15px 15px;border-bottom: 1px solid #ddd;}
.teacher_count div.add > div {background-image: url("{OSSURL}public/mobile/img/state_add.png");}
.teacher_count div.hot > div {background-image: url("{OSSURL}public/mobile/img/state_hot.png");}
.teacher_count  div.new > div{ background-image: url("{OSSURL}public/mobile/img/state_new.png")}
</style>
<div id="wrap" class="teacher_inf">
	<dl id="main">
		<dd class="teacher_inf">
			<div class="teacher">
				<div style=" background-image:url({php echo tomedia($school['logo']);})"></div>
			</div>
			<ul>
				<li><label>学&nbsp;&nbsp;&nbsp;&nbsp;校：</label>{$school['title']}</li>
				<li><label>学校类型：</label>{if !empty($leixing[$school['typeid']])}{$leixing[$school['typeid']]['name']}{/if}</li>
				<li><label>学校地址：</label><span>{$school['address']}</span></li>
			</ul>               
			<div style="clear:both"></div>
		</dd>
		<dd class="teacher_count">
			<h3>课程列表</h3>
			<ul>
			{loop $list $item}					
			   <li class="{if $item['end'] < TIMESTAMP}closed{/if}" onclick="chakan('{$item['id']}');">
					<h4>{$item['name']}</h4>{if $item['is_hot'] == 1}<p>精品课</p>{/if}
					<span> {php echo date('Y/m/d',$item['start'])}-{php echo date('Y/m/d',$item['end'])}</span>
					{if !empty($category[$item['xq_id']])}<span> {$category[$item['xq_id']]['sname']}</span>{/if}
					<span> {if !empty($category[$item['bj_id']])}{$category[$item['bj_id']]['sname']}{/if}</span>
					<span> {if !empty($category[$item['km_id']])}{$category[$item['km_id']]['sname']}{/if}</span>
					<!--通过hot、add和new分别设置热报、正在报名和新增 -->
					{if $item['end']<TIMESTAMP}
					<div class="hot">
						<div style="font-size:12px;">已完</div>                                   
						<a href="{php echo $this->createMobileUrl('kcinfo', array('id' => $item['id'], 'schoolid' =>$schoolid), true)}">查看详情</a>
					</div>
					{else}
					<div class="add">
						<div style="font-size:12px;">{php echo pdo_fetchcolumn("select count(*) FROM ".tablename('wx_school_kcbiao')." WHERE kcid = '".$item['id']."'")}节</div>
						<span>剩余{php echo pdo_fetchcolumn("select count(*) FROM ".tablename('wx_school_kcbiao')." WHERE date>'".TIMESTAMP."' And kcid = '".$item['id']."'")}节</span>
						<a href="{php echo $this->createMobileUrl('kcinfo', array('id' => $item['id'],'schoolid' =>$schoolid), true)}">查看详情</a>
					</div>
					{/if}
			   </li> 
			{/loop}		   
			</ul>
		</dd>
		<div class="selectList" id="selectList" style="z-index:100000;display:none;">
			<div class="single" style="z-index:100000;">
				<ul>
					<span style="color:#444;">切换学生</span>
				{loop $user $row}
					<li onclick="isSelect({$row['id']},{$row['schoolid']});"><span class="le">{$row['bjname']}</span><span class="ri">{$row['s_name']}</span></li>
				{/loop}	
				</ul>
			</div>
		</div>		
	</dl>
</div> 
<input id="flag" value="{$flag}" type="hidden">
<input id="cache" value="{$userss}" type="hidden">
<script type="text/javascript">
	$(function ($) {
        var flag = $("#flag").val();
		var cache = $("#cache").val();
		
        if (flag == 2) {
			if (cache == "" || cache == null) {
			   $('#selectList').show();
			}
		}
	});
	function isSelect(userid,schoolid){
		location.href = "{php echo $this->createMobileUrl('kc')}"+ '&userid=' + userid + '&schoolid=' + schoolid;
		location.href = reload();
	}	
</script>   
<script>
	$(document).ready(function(e) {
		$("#wrap").css("min-height", $(document).height())
	});
    function chakan(id) {

    window.location.href = "{php echo $this->createMobileUrl('kcinfo', array('schoolid' => $schoolid),true)}" + "&id=" + id;

    }		
</script>
{php include $this->template('footer');} 
</body>
</html>